1. Field of the Invention
The invention relates to the field of data buffer, and more particularly to a controlling method and device for data transmission in the dual buffer architecture.
2. Description of the Related Art
To satisfy the higher demand of the quality of the audio and video image, the corresponding multimedia standards have been built up. Since the multimedia data usually require more space to storage and bandwidth to transmit, the corresponding buffer which set up in a player as a data transmission channel is in great demand than before. However, due to the conventional transmission channel devices typically lack of planning such that the switch and intercommunication was impeded and then lower the overall performance.
With regard to the above-mentioned, FIG. 1A is a schematic diagram illustrating the method and device of a buffer as a data transmission channel based on the related art including a data transmission channel 100 as a data buffer that constructed between a host and a peripheral such as a CD-R drive or a CD-RW drive, or constructed in a DVD Player or DVD Recorder, and a system bus 110 coupling to the host. When the system command is “Host Read”, the data sequentially sent to and cached in the data transmission channel 100 before decoding and consequent transmission procedures. However, while the bus adjusting the direction according consequent system command, the data cached in the data transmission channel 100 may be discarded (i.e. “Flush”) so that the data transmission channel 100 which as a common area for temporary storage employed by the data of the successive commands, and the corresponding index modifying its value frequently and terminated all the data processing procedures of the formal command when the last one begin to perform. Consequently, when the incessant switch between random two commands occur frequently, the data transmission channel 100 will result in the shortcomings that consuming the transmission time, transmission not smooth, and lower the performance while waiting the mechanical components to access data, flushing the content of the buffer, re-seeking the raw data, modifying the content of the corresponding indices, etc.
FIG. 2 representing a flowchart of the method for the data transmission channel based on the prior art including steps 210 to 250. At first, Step 210 indicates that the first command data processing procedures based on the first command to transmit the data between the data transmission channel 100 and the bus 110. It's noted that when the first command is “Host Read”, the data of the data transmission channel 100 flows into the bus 110, and the corresponding consequent data processing procedures including of caching data in the data transmission channel 100, decoding (in the channel CODEC), and sending the decoded data away form the data transmission channel 100. On the other hand, when the first command is “Host Write”, the data of the bus 110 flows into the data transmission channel 100, and the corresponding consequent data processing procedures including caching data in the data transmission channel 100, encoding (in the channel CODEC), sending the encoded data away form the data transmission channel 100 and performing related recording procedures. Second, the bus 110 adjusting the transmitting direction in step 220 through comparing the second command to the first one, and taking step 230 for retrieving and caching the data of the second command in the data transmission channel 100 that the location of the cached data will follows the one of the first command since these two commands are the same, otherwise taking step 240 to discard the data of the first command that cached in the data transmission channel 100, and performing the related procedures in step 250. It's noted that the parts of processing procedures of the first command will terminate when the data processing procedures of the second command began to perform, or it will result in the problem associated with inconsistence and incorrectness of data processing.
Hence, the above discussion on the techniques of prior art have at least two drawbacks. First, the decoded and cached data will be discarded when the command “Host Read” switched to the command “Host Write”, and also it will cause delays since the common and single data transmission channel can't be use by the command “Host Write” and the command “Host Read” at one time. Second, while the incessant switch between random two commands occur frequently, it may cause the frequent re-seeking, exhausting the transmission time, and lacking of efficiency, etc.